using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace XiaoMan.Model.Models.Mapping
{
    public class Sys_UsersMap : EntityTypeConfiguration<Sys_Users>
    {
        public Sys_UsersMap()
        {
            // Primary Key
            this.HasKey(t => t.UserID);

            // Properties
            this.Property(t => t.UserName)
                .HasMaxLength(50);

            this.Property(t => t.PassWord)
                .HasMaxLength(50);

            this.Property(t => t.Mobile)
                .IsFixedLength()
                .HasMaxLength(11);

            this.Property(t => t.UserPic)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Sys_Users");
            this.Property(t => t.UserID).HasColumnName("UserID");
            this.Property(t => t.UserName).HasColumnName("UserName");
            this.Property(t => t.PassWord).HasColumnName("PassWord");
            this.Property(t => t.Sex).HasColumnName("Sex");
            this.Property(t => t.Birthday).HasColumnName("Birthday");
            this.Property(t => t.Mobile).HasColumnName("Mobile");
            this.Property(t => t.Province).HasColumnName("Province");
            this.Property(t => t.City).HasColumnName("City");
            this.Property(t => t.UserPic).HasColumnName("UserPic");
            this.Property(t => t.IsDelFlag).HasColumnName("IsDelFlag");
            this.Property(t => t.CreatTime).HasColumnName("CreatTime");
        }
    }
}
